//
//  GRGoodTableViewCell.m
//  YC_GRice
//
//  Created by luojinrong11 on 2018/7/8.
//  Copyright © 2018年 YeCai. All rights reserved.
//

#import "GRGoodTableViewCell.h"
@interface GRGoodTableViewCell()
@property (weak, nonatomic) IBOutlet UIImageView *goodImageView;
@property (weak, nonatomic) IBOutlet UILabel *goodNameLabel;

@property (weak, nonatomic) IBOutlet UILabel *specLabel;

@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (weak, nonatomic) IBOutlet UILabel *originalLabel;

@property (weak, nonatomic) IBOutlet UILabel *countLabel;

@end
@implementation GRGoodTableViewCell


-(void)setOrderGoodModel:(GRConfirmOrderGoodModel *)orderGoodModel{
    _orderGoodModel = orderGoodModel;
    self.rightOffset.constant = 10;
    self.leftOffset.constant = 10;
    [self.goodImageView sd_setImageWithURL:[NSURL URLWithString:orderGoodModel.imgUrl] placeholderImage:[UIImage imageNamed:@""]];
    self.goodNameLabel.text = orderGoodModel.goodsName;
    self.specLabel.text = orderGoodModel.specDesc;
    self.priceLabel.text = [NSString stringWithFormat:@"￥%.2lf",[orderGoodModel.price floatValue]];
    self.originalLabel.text = [NSString stringWithFormat:@"￥%.2lf",[orderGoodModel.originPrice floatValue]];
    self.countLabel.text = [NSString stringWithFormat:@"x%ld", orderGoodModel.quantity];
    
}

-(void)setGoodModel:(GROrderListGoodModel *)goodModel{
    _goodModel = goodModel;
    self.rightOffset.constant = 0;
    self.leftOffset.constant = 0;
    [self.goodImageView sd_setImageWithURL:[NSURL URLWithString:goodModel.imgUrl] placeholderImage:[UIImage imageNamed:@""]];
    self.goodNameLabel.text = goodModel.goodsName;
    self.specLabel.text = goodModel.specDesc;
    
    self.priceLabel.text = [NSString stringWithFormat:@"￥%.2lf",goodModel.goodsPrice];
    self.originalLabel.text = [NSString stringWithFormat:@"￥%.2lf",goodModel.originPrice];
    self.countLabel.text = [NSString stringWithFormat:@"x%ld", goodModel.quantity];
}


- (void)awakeFromNib {
    [super awakeFromNib];
 
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
